<?php
class Client extends AppModel {
	var $name = 'Client';
	var $validate = array(
		'name' => array(
			'notempty' => array(
				'rule' => 'isUnique',
				'message' => 'El Nombre del Consultorio ya existe en la Base de Datos. Por favor, seleccione otro nombre para su Consultorio.',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'sponsor' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'skyscraper' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'email' => array(
			'regla1' => array(
			    'rule' => array('email'),
			    'message' => 'Ingrese una cuenta de Email válida.',
			    // extra keys like on, required, etc. go here...
			),
			'regla2' => array(
			    'rule' => 'isUnique',
			    'message' => 'El Email ingresado ya está en uso por otro Cliente.',
			    // extra keys like on, required, etc. go here...
			),
		),
		'country_id' => array(
			'numeric' => array(
				'rule' => array('numeric'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'stateclient_id' => array(
			'numeric' => array(
				'rule' => array('numeric'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
	);

	//The Associations below have been created with all possible keys, those that are not needed can be removed

	var $belongsTo = array(
		'Country' => array(
			'className' => 'Country',
			'foreignKey' => 'country_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Stateclient' => array(
			'className' => 'Stateclient',
			'foreignKey' => 'stateclient_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);

	var $hasMany = array(
		'Combo' => array(
			'className' => 'Combo',
			'foreignKey' => 'client_id',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		),
		'License' => array(
			'className' => 'License',
			'foreignKey' => 'client_id',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		),
		'RolsUser' => array(
			'className' => 'RolsUser',
			'foreignKey' => 'client_id'
		),
		'ClientsPerson' => array(
			'className' => 'ClientsPerson',
			'foreignKey' => 'client_id',
			'dependent' => false
		),
		'ClientsProduct' => array(
			'className' => 'ClientsProduct',
			'foreignKey' => 'client_id',
			'dependent' => false
		),
		'ClientsSponsor' => array(
			'className' => 'ClientsSponsor',
			'foreignKey' => 'client_id',
			'dependent' => false
		),
		'ClientsUser' => array(
			'className' => 'ClientsUser',
			'foreignKey' => 'client_id',
			'dependent' => false
		),
		'ClientsFeriado' => array(
			'className' => 'ClientsFeriado',
			'foreignKey' => 'client_id',
			'dependent' => false
		)
	);

}
?>